package lion.test.cms;

import javax.servlet.http.HttpServletRequest;

import lion.framework.core.web.anno.MultiPath;
import lion.framework.core.web.anno.Namespace;
import lion.framework.core.web.anno.Path;
import lion.framework.core.web.anno.Result;
import lion.framework.core.web.anno.View;
import lion.framework.core.web.request.Request;
import lion.framework.core.web.request.RequestMethod;
import lion.framework.core.web.views.ResultType;

@Namespace("/admin/")
public class AdminService {

	@MultiPath({ @Path(value = { "/index", "/default" }, method = RequestMethod.GET), @Path(value = "/admin", method = RequestMethod.POST) })
	@Result({ @View(name = "success", value = "/admin/second", type = ResultType.FORWARD), @View(name = "error", value = "") })
	public String index(Request request) {

		request.addModel("aaaa", "bbbbbbbbb");

		return "success";
	}

	@Path("/second")
	public void bbbbb(HttpServletRequest request) {

		System.out.println(request.getAttribute("aaaa"));

		System.out.println("asdfsadfasd");
	}
}
